Misc icon tweaks, relax lint rules#36046
Conversation
|
Regarding |
Maybe this icon is actually fine. I think a repo book icon with a padlock is better than a padlock only. We do not have a "locked" state yet for repos, so this icon is unambiguous too. |
|
One more minor change, |
|
A repository can fall into several state groups:
We can add icons for the states in Group 1, and use text labels for the other groups to maintain consistency and avoid visual conflicts. |
|
Sounds like a plan, I will try that. |
|
Applied that logic, so there is only 3 states of the repo icon now. Also, I disabled lint rules that forbid "else-return" constructs. I find those just annoying because they forbid code like this and fixing it breaks the symmetry of the block which looks ugly. } else {
return 'octicon-repo';
} |
Signed-off-by: silverwind <me@silverwind.io>
|
Ready now, I think it's a good cleanup and now all repo icons are the same everywhere. |
| {{else}} | ||
| <span class="icon">{{svg "octicon-repo"}}</span> | ||
| {{end}} | ||
| {{template "repo/icon" (dict "Repo" $repo "Size" 16)}} |
There was a problem hiding this comment.
It's better to have labels(private, template & etc.) for this repository
There was a problem hiding this comment.
You mean adding labels in this specific place (and below)?
There was a problem hiding this comment.
I mean, it appears that the labels are only shown on the repository detail page. They could also be displayed on the list page, but I’m not sure whether we should enable that.
There was a problem hiding this comment.
In lists we can add them, yes.
| {{else}} | ||
| {{svg "octicon-repo"}} | ||
| {{end}} | ||
| {{template "repo/icon" (dict "Repo" . "Size" 16)}} |
| {{else if $repo.IsMirror}} | ||
| <span class="icon">{{svg "octicon-mirror"}}</span> | ||
| {{else if $repo.IsTemplate}} | ||
| <span class="icon">{{svg "octicon-repo-template"}}</span> |
There was a problem hiding this comment.
IsTemplate is missing in icon.tmpl
If intentionally, should the comment #36046 (comment) be added to the template code? ps: I don't understand why IsTemplate is in a separate "group".
There was a problem hiding this comment.
Both mirror repositories and regular repositories(public or private) could be template repositories.
There was a problem hiding this comment.
If intentionally, should the comment #36046 (comment) be added to the template code? ps: I don't understand why IsTemplate is in a separate "group".
If intentionally, should the comment #36046 (comment) be added to the template code?
There was a problem hiding this comment.
I can add it. And yes I've implemented that only group 1 is represented with the icon, all other groups are represented with tags in places that have enough room to display them (not on frontpage repo list).
There was a problem hiding this comment.
Thought maybe we should make an exception for templates. I think it's highly unlikely that a repo is both a mirror and a template, so I guess showing a template icon in such a case would make more sense.
There was a problem hiding this comment.
Pull request overview
This pull request improves icon consistency across the Gitea UI and removes the deprecated "gold" color styling for private repositories and organizations. The changes consolidate repository icon logic into a reusable utility function and fix semantically incorrect icon usage.
Changes:
- Fixed pull request icons on the pulse page (using
octicon-git-mergefor merged PRs andocticon-git-pull-requestfor open PRs) - Removed gold color styling from private repo/org indicators throughout admin and user settings templates
- Consolidated repo icon logic into a new
getRepoIconutility function with corresponding template refactoring - Relaxed lint rules (
no-else-returnin ESLint andindent-error-flowin golangci) to accommodate clearer code patterns
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| web_src/js/utils/mappings.ts | New utility function getRepoIcon to centralize repo icon logic |
| web_src/js/components/DashboardRepoList.vue | Refactored to use new getRepoIcon utility, removing duplicate icon selection logic |
| web_src/css/themes/theme-gitea-light.css | Removed --color-gold CSS variable |
| web_src/css/themes/theme-gitea-dark.css | Removed --color-gold CSS variable |
| web_src/css/base.css | Removed .text.gold class definition |
| templates/user/settings/repos.tmpl | Replaced inline icon logic with repo/icon template calls |
| templates/shared/repo/list.tmpl | Updated to use repo/icon template; fixed fork count icon from octicon-git-branch to octicon-repo-forked |
| templates/repo/pulse.tmpl | Fixed PR icons: octicon-git-merge for merged, octicon-git-pull-request for proposed |
| templates/repo/icon.tmpl | Refactored to accept dict parameters (Repo, Size, ShowRepoAvatar, ShowRepoOwnerAvatar) |
| templates/repo/header.tmpl | Updated to use new repo/icon template syntax with dict params |
| templates/org/team/repositories.tmpl | Updated to use new repo/icon template syntax with dict params |
| templates/admin/repo/list.tmpl | Removed gold color class from private owner indicators |
| templates/admin/packages/list.tmpl | Removed gold color class from private owner indicators |
| templates/admin/org/list.tmpl | Removed gold color class from private org indicators |
| eslint.config.ts | Relaxed no-else-return rule to allow clearer code patterns |
| .golangci.yml | Removed indent-error-flow rule to allow more flexible error handling patterns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: silverwind <me@silverwind.io>

Useocticon-repo-lockedto indicate private repos, also visible on the repo header nowUseocticon-repo-forkedto indicate forked repos